package com.thinkingblackberry;

import java.io.ByteArrayOutputStream;  
import java.io.IOException;  
import java.io.InputStream;  
  
import net.rim.device.api.ui.Field;  
import net.rim.device.api.ui.FieldChangeListener;  
import net.rim.device.api.ui.Manager;  
import net.rim.device.api.ui.Screen;  
import net.rim.device.api.ui.component.AutoTextEditField;  
import net.rim.device.api.ui.component.EditField;  
import net.rim.device.api.ui.component.RichTextField;  
import net.rim.device.api.ui.container.VerticalFieldManager;  
  
public class ChatScreen extends Screen {  
    private ChatLayoutManager chatManager;  
    private RichTextField richTextField;  
    private EditField editField;  
  
    public ChatScreen() {  
        super(new ChatLayoutManager(0), Screen.DEFAULT_CLOSE | Screen.DEFAULT_MENU);  
  
        chatManager = (ChatLayoutManager)getDelegate();  
  
        VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);  
       // String str = getSampleText();  
  
        richTextField = new RichTextField("qqq");  
        vfm.add(richTextField);  
        editField = new AutoTextEditField("Chat:", "");  
        
        chatManager.setBottomField(editField);  
        chatManager.setMainField(vfm);  
    }  
  
    protected void sublayout(int width, int height) {  
        setPositionDelegate(0, 0);  
        layoutDelegate(width, height);  
        setPosition(0, 0);  
        setExtent(width, height);  
    }  
  
    
}  
